<template>
  <div class="bodys">
    <top-data></top-data>

    <div class="w subject">
      <div class="sidebar">
        <div class="sidebar-son">
          <ul>
            <li>
              <p>订单中心</p>
            </li>
            <li>
              <p @click="xuanzhong('dd')">我的订单</p>
            </li>
            <li>
              <p>评价晒单</p>
            </li>
          </ul>
        </div>
        <div class="sidebar-son">
          <ul>
            <li>
              <p @click="xuanzhong('gr')">个人中心</p>
            </li>
            <li>
              <p @click="xuanzhong('xdx')">我的小度星</p>
            </li>
            <li>
              <p>我的优惠价</p>
            </li>
            <li>
              <p>我的拼团</p>
            </li>
            <li>
              <p>我的福利</p>
            </li>
          </ul>
        </div>
        <div class="sidebar-son">
          <ul>
            <li>
              <p>售后服务</p>
            </li>
            <li>
              <p>申请售后</p>
            </li>
            <li>
              <p>服务记录</p>
            </li>
          </ul>
        </div>
        <div class="sidebar-son">
          <ul>
            <li>
              <p>设置</p>
            </li>
            <li>
              <p @click="xuanzhong('dz')">收货地址</p>
            </li>
            <li>
              <p>账号管理</p>
            </li>
          </ul>
        </div>
      </div>
      <div class="right-content">
        <personalCenter v-if="values=='gr'"></personalCenter>
        <my-order @toOrderDetails="toOrderDetails" v-if="values=='dd'&&dindan==-1"></my-order>
        <receipt-data v-if="values=='dz'"></receipt-data>
        <baidu-star v-if="values=='xdx'"></baidu-star>

        <order-details :dindan="dindan" @fanhui="fanhui" v-if="dindan!=-1"></order-details>
      </div>
    </div>

    <foot-data></foot-data>
  </div>
</template>

<script>
import topData from "@/components/topData.vue";
import FootData from "@/components/footData.vue";
import personalCenter from "@/components/personalCenter.vue";
import MyOrder from "@/components/myOrder.vue";
import OrderDetails from '@/components/orderDetails.vue';
import ReceiptData from '@/components/receiptData.vue';
import BaiduStar from '@/components/baiduStar.vue';
export default {
  data() {
    return {
        values:"gr",
        dindan:-1
    };
  },
  methods:{
    xuanzhong(value){
        this.values=value
    },
    toOrderDetails(index){
      this.dindan=index
    },
    fanhui(){
      this.dindan=-1
    }
  },
  created(){
    this.values=this.$route.query.value
  },
  components: { topData, FootData, personalCenter, MyOrder, OrderDetails, ReceiptData, BaiduStar },
};
</script>

<style lang="scss" scoped>
@import "../assets/css/public.scss";
@import "../assets/css/my.scss";
</style>